package com.tianjian.myblog.service;

import com.tianjian.myblog.dao.UserRepository;
import com.tianjian.myblog.model.User;
import com.tianjian.myblog.util.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserRepository repository;
    @Override
    public User checkUser(String username, String password) {

        User user = repository.findByUsernameAndPassword(username, MD5Utils.code(password));

        return user;
    }
}
